package org.chuan.hisports.util;

import org.apache.commons.codec.binary.Base64;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Scanner;

//MD5加密
public class MD5Util {
    public static String encryption(String str) throws NoSuchAlgorithmException {
        MessageDigest md5 = MessageDigest.getInstance("md5");
        String newStr = Base64.encodeBase64String(md5.digest(str.getBytes()));
        System.out.println(newStr);
        return newStr;
    }

}
